php商城虚拟卡,商城后台新增虚拟卡券模块问题

common\local\local_services\Coupon 代码如下:

namespace common\local\local_services;

use fecshop\services\Service;

use Yii;

class Coupon extends Service

{

/**

* $storagePrex , $storage , $storagePath 为找到当前的storage而设置的配置参数

* 可以在配置中更改,更改后,就会通过容器注入的方式修改相应的配置值

*/

public $storage; // 当前的storage,在config中配置,在初始化的时候会被注入修改

/**

* 设置storage的path路径,

* 如果不设置,则系统使用默认路径

* 如果设置了路径,则使用自定义的路径

*/

public $storagePath;

protected $_coupon;

public function init()

{

parent::init();

$currentService = $this->getStorageService($this);

$this->_coupon = new $currentService();

}

/**

* get artile's primary key.

*/

protected function actionGetPrimaryKey()

{

return $this->_coupon->getPrimaryKey();

}

/**

* get artile model by primary key.

*/

protected function actionGetByPrimaryKey($primaryKey)

{

return $this->_coupon->getByPrimaryKey($primaryKey);

}

/**

* 得到category model的全名.

*/

protected function actionGetModelName()

{

return get_class($this->_coupon);

}

/**

* @property $filter|array

* get artile collection by $filter

* example filter:

* [

* 'numPerPage' => 20,

* 'pageNum'=> 1,

* 'orderBy'=> ['_id' => SORT_DESC, 'sku' => SORT_ASC ],

'where'=> [

['>','price',1],

['<=','price',10]

* ['sku' => 'uk10001'],

* ],

* 'asArray' => true,

* ]

*/

protected function actionColl($filter = '')

{

return $this->_coupon->coll($filter);

}

/**

* @property $one|array , save one data .

* @property $originUrlKey|string , article origin url key.

* save $data to cms model,then,add url rewrite info to system service urlrewrite.

*/

protected function actionSave($one, $originUrlKey)

{

return $this->_coupon->save($one, $originUrlKey);

}

protected function actionRemove($ids)

{

return $this->_coupon->remove($ids);

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值