12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?php
- namespace app\dao\activity\coupon;
- use app\dao\BaseDao;
- use app\model\activity\coupon\StoreCoupon;
- class StoreCouponDao extends BaseDao
- {
-
- protected function setModel(): string
- {
- return StoreCoupon::class;
- }
-
- public function getList(array $where, int $page, int $limit)
- {
- return $this->search($where)->page($page, $limit)->order('sort desc,id desc')->select()->toArray();
- }
-
- public function setIssue($cid, $total_count = 0, $start_time = 0, $end_time = 0, $remain_count = 0, $status = 0, $is_permanent = 0, $full_reduction = 0, $is_give_subscribe = 0, $is_full_give = 0)
- {
- $add_time = time();
- $data['cid'] = $cid;
- $data['start_time'] = $start_time;
- $data['end_time'] = $end_time;
- $data['total_count'] = $total_count;
- $data['remain_count'] = $remain_count;
- $data['is_permanent'] = $is_permanent;
- $data['status'] = $status;
- $data['is_give_subscribe'] = $is_give_subscribe;
- $data['is_full_give'] = $is_full_give;
- $data['full_reduction'] = $full_reduction;
- $data['add_time'] = $add_time;
- return $this->getModel()->create(compact('cid', 'start_time', 'end_time', 'total_count', 'remain_count', 'is_permanent', 'status', 'is_give_subscribe', 'is_full_give', 'full_reduction', 'add_time'));
- }
- }
|