生成用户收货码

This commit is contained in:
yaooo 2023-08-10 11:13:45 +08:00
parent 0acbd431d7
commit 7e80444924
2 changed files with 18 additions and 3 deletions

View File

@ -55,7 +55,11 @@ class Auth extends BaseController
{
public function dotest()
{
return app('json')->success([]);
$code = random_int(1000, 9999);
$res = app()->make(StoreOrderRepository::class)->update(0, [
'logistics_code' => $code
]);
return app('json')->success($res);
}
public function test()

View File

@ -6,6 +6,7 @@ namespace app\listener;
use app\common\dao\store\order\StoreCartDao;
use app\common\dao\system\merchant\MerchantDao;
use app\common\model\system\merchant\Merchant;
use app\common\repositories\store\order\StoreOrderRepository;
use app\common\repositories\system\merchant\FinancialRecordRepository;
use app\common\repositories\system\merchant\MerchantRepository;
use crmeb\utils\DingTalk;
@ -138,9 +139,19 @@ class paySuccessOrder
}
//发起物流信息
$this->sendLogistics($this->event['order']['order_id'], $this->event['order']['order_sn']);
//生成商家给的物流取货二维码
//生成用户的收货码、发生短信包含收货码
$this->generateLogisticsCode($orderId);
}
//用户收货码
public function generateLogisticsCode($orderId) {
$code = random_int(1000, 9999);
$res = app()->make(StoreOrderRepository::class)->update($orderId, [
'logistics_code' => $code
]);
if ($res) {
//发生短信
}
}
//发送物流