You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
836 B

<?php
namespace app\common;
use think\facade\Db;
class SlashCard
{
public static function updateUser($order)
{
//判斷是否為SlashCard商品
$is_main = Db::name('order_goods')
->where('order_id', $order['order_id'])
->where('goods_id', 1)
->find();
if ($is_main) {
$rtn = \app\service\Card::addUser([
'order_sn' => $order['order_sn'],
'user_id' => Db::name('users')->where('user_id', $order['user_id'])->value('sso_user_id'),
]);
if ($rtn['code'] != 200) {
return ['code' => $rtn['code'], 'msg' => '更新slashcard失敗'];
}
return $rtn;
}else{
return ['code' => 201, 'msg' => '訂單無slashcard商品'];
}
}
}