1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- /**
- * Author: luzheng.liu
- * Time: 2020/9/18 18:01
- */
- namespace app\common\model\sqlsev;
- use app\common\service\HelperService;
- use app\cron\controller\MigrateData;
- class CouponModel extends sqlSerModel {
- protected $table = 'tabPromoConfig';
- //select * from tabPromoConfig where strHQCode='126' and blnState=0 and strPromoMode='Coupon' and strCouponTypeCode='1001'
- /**
- * 获取现金券
- * @return mixed
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\ModelNotFoundException
- * @throws \think\exception\DbException
- */
- public function getCoupon() {
- $rs = $this->where(['strHQCode' => MigrateData::BX, 'blnState' => 0, 'strPromoMode' => 'Coupon', 'strCouponTypeCode' => 1001,
- ])->order(['intPromoConfigID' => 'asc'])->select();
- return HelperService::object2Arr($rs);
- }
- /**
- * 获取产品券
- * @return mixed
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\ModelNotFoundException
- * @throws \think\exception\DbException
- */
- public function getProductCoupon() {
- $rs = $this->where(['strHQCode' => MigrateData::BX, 'blnState' => 0, 'strPromoMode' => 'Coupon', 'strCouponTypeCode' => 1002,
- ])->order(['intPromoConfigID' => 'asc'])->select();
- return HelperService::object2Arr($rs);
- }
- }
|