public static function storeShopFrontImage($imageName, $imageData)
 {
     if ($imageData == '') {
         echo response::show(201, 'shopfrontPic不能为空');
     }
     $fullImageName = cShopFrontPath . $imageName;
     if (storeUploadImage::storeImage($fullImageName, $imageData)) {
         echo 'shopfrontPic图片保存成功';
         return cPicUrlHeader . $fullImageName;
     } else {
         echo response::show(201, 'shopfrontPic图片保存失败');
     }
 }
示例#2
0
    $mobilePhone = $_REQUEST['$mobilePhone'];
    $sortF = $_REQUEST['$sortF'];
    $sortS = $_REQUEST['$sortS'];
    $privileges = $_REQUEST['$privileges'];
    $description = $_REQUEST['$description'];
    $serviceindex = $_REQUEST['$serviceindex'];
    $province = $_REQUEST['$province'];
    $city = $_REQUEST['$city'];
    $addresDetail = $_REQUEST['$addresDetail'];
    $fixTelephone = $_REQUEST['$fixTelephone'];
    // 字符必须添加'',数字不必添加
    $sqlUpdate = "UPDATE\n                          `business`\n                    SET\n                          `name` = '{$businessName}',\n                          `sortF` = {$sortF},\n                          `sortS` = {$sortS},\n                          `privileges` = '{$privileges}',\n                          `picUrl` = '{$shopfrontPic}',\n                          `description` = '{$description}',\n                          `businessSTime` = {$startTime},\n                          `businessETime` = {$endTime},\n                          `licensePicUrl` = '{$licencePic}',\n                          `mobilePhone` = '{$mobilePhone}',\n                          `serviceindex` = {$serviceindex},\n                          `longitude` = {$lon},\n                          `latitude` = {$lat},\n                          `province` = {$province},\n                          `city` = {$city},\n                          `addresDetail` = '{$addresDetail}',\n                          `fixTelephone` = '{$fixTelephone}'\n                    WHERE\n                          `business`.`id` = {$businessId}";
    $connect = db::getInstance()->connect();
    $result = mysqli_query($connect, $sqlUpdate);
    if ($result) {
        echo '更新基本数据成功';
    } else {
        echo response::show(201, '更新基本数据失败');
    }
}
$businessId = $_REQUEST['$businessId'];
// id+time+.jpg
$ImageName = $_REQUEST['$businessId'] . time() . '.jpg';
// 1.身份验证
authentication($_REQUEST['mgrPhone'], $_REQUEST['mgrPwd'], $businessId);
// 2.保存门面照
$shopfrontPic = storeUploadImage::storeShopFrontImage($ImageName, $_REQUEST['$shopfrontPic']);
// 3.保存营业执照
$licencePic = storeUploadImage::storeLicenceImage($ImageName, $_REQUEST['$licencePic']);
// 4.更新基本数据
updateBusinessInfor($businessId, $shopfrontPic, $licencePic);