|
|
@@ -23,7 +23,7 @@ use crmeb\repositories\ShortLetterRepositories;
|
|
|
use crmeb\services\{
|
|
|
MiniProgramService, UtilService, WechatService
|
|
|
};
|
|
|
-use app\models\store\{StoreCart, StoreExchangeOrder, StoreOrder, StoreOrderStatus, StorePink, StoreService};
|
|
|
+use app\models\store\{Card, StoreCart, StoreExchangeOrder, StoreOrder, StoreOrderStatus, StorePink, StoreService};
|
|
|
use app\models\system\SystemStoreStaff;
|
|
|
|
|
|
/**
|
|
|
@@ -81,6 +81,35 @@ class StoreOrderController
|
|
|
return app('json')->successful('ok', ['data' => SystemStorePoint::getStoreDispose($id)]);
|
|
|
}
|
|
|
|
|
|
+ public function sendCard(Request $request)
|
|
|
+ {
|
|
|
+ $uid = $request->uid();
|
|
|
+ $info = SystemStoreStaff::where('uid', $uid)->where('status', 1)->find();
|
|
|
+ if (!$info) {
|
|
|
+ return app('json')->fail('权限不足');
|
|
|
+ }
|
|
|
+ $code = UtilService::postMore(['code']);
|
|
|
+ $res = Card::sendCard($info['store_id'], $code);
|
|
|
+ if ($res)
|
|
|
+ return app('json')->successful('赠送成功');
|
|
|
+ else return app('json')->fail(Card::getErrorInfo('赠送失败'));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public function checkCard(Request $request)
|
|
|
+ {
|
|
|
+ $uid = $request->uid();
|
|
|
+ $info = SystemStoreStaff::where('uid', $uid)->where('status', 1)->find();
|
|
|
+ if (!$info) {
|
|
|
+ return app('json')->fail('权限不足');
|
|
|
+ }
|
|
|
+ $code = UtilService::postMore(['code', 'password']);
|
|
|
+ $res = Card::checkCard($info['store_id'], $code['code'], $code['password']);
|
|
|
+ if ($res)
|
|
|
+ return app('json')->successful('核销成功');
|
|
|
+ else return app('json')->fail(Card::getErrorInfo('核销失败'));
|
|
|
+ }
|
|
|
+
|
|
|
public function addDetail(Request $request, $id = 0)
|
|
|
{
|
|
|
$uid = $request->uid();
|