|
...
|
...
|
@@ -726,6 +726,63 @@ class Seller extends Common |
|
|
|
return $res;
|
|
|
|
}
|
|
|
|
|
|
|
|
//获取商家接单时的选中项
|
|
|
|
public function get_seller_config_mode(){
|
|
|
|
$data = Request::except('file');
|
|
|
|
$seller_config_res = Db::query('SELECT * from `xt-member-two-LINE`.xt_dc_dz_seller_config where sid ='.$data['sid'].' GROUP by sid');
|
|
|
|
if(!empty($seller_config_res[0])) {
|
|
|
|
$seller_user_openid_array = array();
|
|
|
|
//获取小程序是否可选择
|
|
|
|
$seller_user_openid_array = Db::query('SELECT
|
|
|
|
a.openid,
|
|
|
|
u.nick_name,
|
|
|
|
u.phone
|
|
|
|
FROM
|
|
|
|
`xt-member-two-LINE`.xt_dc_seller_user AS u
|
|
|
|
LEFT JOIN `xt-member-two-LINE`.xt_auth_user AS a ON u.auth_user_id = a.id
|
|
|
|
WHERE
|
|
|
|
u.is_on_call = 1
|
|
|
|
AND u.sellerid = '.$data['sid']);
|
|
|
|
$seller_user_openid = $seller_user_openid_array ? $seller_user_openid_array[0]['openid'] : '';
|
|
|
|
|
|
|
|
if($seller_user_openid_array[0]['phone']==NULL || $seller_user_openid_array[0]['phone'] ==''){
|
|
|
|
$seller_user_openid_array[0]['phone'] = '电话未填写';
|
|
|
|
$seller_user_openid_array[0]['phone_status'] = 1;
|
|
|
|
}
|
|
|
|
//检测是否关注公众号
|
|
|
|
if($seller_user_openid){
|
|
|
|
$seller_user_unionid = Db::query('SELECT
|
|
|
|
openid
|
|
|
|
FROM
|
|
|
|
`xt-member-two-LINE`.xt_wechat
|
|
|
|
WHERE
|
|
|
|
unionid = ( SELECT unionid FROM `xt-member-two-LINE`.xt_wechat WHERE openid = "'.$seller_user_openid.'" )
|
|
|
|
AND source = 0');
|
|
|
|
$seller_user_unionid = $seller_user_unionid ? $seller_user_unionid[0]['openid'] : '';
|
|
|
|
//未关注公众号则不能勾选小程序
|
|
|
|
if($seller_user_unionid==''){
|
|
|
|
$seller_user_openid_array[0]['is_openid_wechat'] = 0;
|
|
|
|
$seller_user_openid_array[0]['is_openid_wechat_str'] = '未关注公众号';
|
|
|
|
}else{
|
|
|
|
$seller_user_openid_array[0]['is_openid_wechat'] = 1;
|
|
|
|
$seller_user_openid_array[0]['is_openid_wechat_str'] = '已关注公众号';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$seller_config_res[0]['user_info'] = [];
|
|
|
|
array_push($seller_config_res[0]['user_info'], $seller_user_openid_array[0]);
|
|
|
|
$seller_config_res[0]['user_info'] = $seller_config_res[0]['user_info'][0];
|
|
|
|
|
|
|
|
$res['code'] = 1;
|
|
|
|
$res['list'] = $seller_config_res[0];
|
|
|
|
$res['msgs'] = 'SUCCESS';
|
|
|
|
}else{
|
|
|
|
$res['code'] = 0;
|
|
|
|
$res['list'] = array();
|
|
|
|
$res['msgs'] = '请联系管理员处理!';
|
|
|
|
}
|
|
|
|
return $res;
|
|
|
|
}
|
|
|
|
|
|
|
|
//获取短信模板内容
|
|
|
|
public function get_sms_detail_seller($code){
|
|
|
|
//根据code获取模板内容
|
...
|
...
|
|