|
@@ -75,6 +75,7 @@ class MigrateData {
|
|
$memberCouponModel = new MemberCouponModel();
|
|
$memberCouponModel = new MemberCouponModel();
|
|
$userModel = new MemberModel();
|
|
$userModel = new MemberModel();
|
|
$where = ['strHQCode' => self::BX];
|
|
$where = ['strHQCode' => self::BX];
|
|
|
|
+// $where['strCouponCode'] = 13;
|
|
$where['strCouponCode'] = ['in', array_keys($countConfigData)];
|
|
$where['strCouponCode'] = ['in', array_keys($countConfigData)];
|
|
$count = $memberCouponModel->where($where)->count();
|
|
$count = $memberCouponModel->where($where)->count();
|
|
$userCoupon = new UserCouponModel();
|
|
$userCoupon = new UserCouponModel();
|
|
@@ -97,7 +98,7 @@ class MigrateData {
|
|
}
|
|
}
|
|
$data = [
|
|
$data = [
|
|
'user_no' => $userNo,
|
|
'user_no' => $userNo,
|
|
- 'coupon_id' => $countConfigData[$couponInfo['strCouponCode']],
|
|
|
|
|
|
+ 'coupon_id' => 13,
|
|
'start_time' => strtotime($couponInfo['datBegin']),
|
|
'start_time' => strtotime($couponInfo['datBegin']),
|
|
'end_time' => strtotime($couponInfo['datEnd']),
|
|
'end_time' => strtotime($couponInfo['datEnd']),
|
|
'use_time' => strtotime($couponInfo['datVerificationTime']),
|
|
'use_time' => strtotime($couponInfo['datVerificationTime']),
|
|
@@ -106,6 +107,7 @@ class MigrateData {
|
|
'add_ts' => strtotime($couponInfo['datDateTime']),
|
|
'add_ts' => strtotime($couponInfo['datDateTime']),
|
|
];
|
|
];
|
|
$userCoupon->insert($data);
|
|
$userCoupon->insert($data);
|
|
|
|
+ var_dump($userNo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -119,24 +121,25 @@ class MigrateData {
|
|
*/
|
|
*/
|
|
public function couponConfig() {
|
|
public function couponConfig() {
|
|
$couponModel = new CouponModel();
|
|
$couponModel = new CouponModel();
|
|
- $bxCoupon = new \app\common\model\bx\CouponModel();
|
|
|
|
|
|
+// $bxCoupon = new \app\common\model\bx\CouponModel();
|
|
//select * from tabPromoConfig where strHQCode='126' and blnState=0 and strPromoMode='Coupon' and strCouponTypeCode='1001'
|
|
//select * from tabPromoConfig where strHQCode='126' and blnState=0 and strPromoMode='Coupon' and strCouponTypeCode='1001'
|
|
$data = [];
|
|
$data = [];
|
|
$couponList = $couponModel->getCoupon();
|
|
$couponList = $couponModel->getCoupon();
|
|
|
|
+
|
|
foreach ($couponList as $info) {
|
|
foreach ($couponList as $info) {
|
|
- $id = $bxCoupon->insertGetId([
|
|
|
|
- 'coupon_name' => $info['strValue2'],
|
|
|
|
- 'type' => $info['intValidityType'],
|
|
|
|
- 'full_money' => $info['strValue'],
|
|
|
|
- 'discount_money' => $info['strValue1'],
|
|
|
|
- 'start_time' => strtotime($info['datBeginDate']),
|
|
|
|
- 'end_time' => strtotime($info['datEndDate']),
|
|
|
|
- 'receive_day' => $info['intValidityBegin'],
|
|
|
|
- 'day' => $info['intValidityEnd'],
|
|
|
|
- 'remark' => $info['strValue3'],
|
|
|
|
- 'bloc_code' => 'BAIXIONG',
|
|
|
|
- ]);
|
|
|
|
- $data[$info['strCode']] = $id;
|
|
|
|
|
|
+// $id = $bxCoupon->insertGetId([
|
|
|
|
+// 'coupon_name' => $info['strValue2'],
|
|
|
|
+// 'type' => $info['intValidityType'],
|
|
|
|
+// 'full_money' => $info['strValue'],
|
|
|
|
+// 'discount_money' => $info['strValue1'],
|
|
|
|
+// 'start_time' => strtotime($info['datBeginDate']),
|
|
|
|
+// 'end_time' => strtotime($info['datEndDate']),
|
|
|
|
+// 'receive_day' => $info['intValidityBegin'],
|
|
|
|
+// 'day' => $info['intValidityEnd'],
|
|
|
|
+// 'remark' => $info['strValue3'],
|
|
|
|
+// 'bloc_code' => 'BAIXIONG',
|
|
|
|
+// ]);
|
|
|
|
+ $data[$info['strCode']] = 13;
|
|
}
|
|
}
|
|
return $data;
|
|
return $data;
|
|
}
|
|
}
|