| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace biz\shop\classes;
- use common\components\util;
- use Yii;
- use biz\base\classes\BaseClass;
- class ShopExpressClass extends BaseClass
- {
- public static $baseFile = '\biz\shop\models\ShopExpress';
- //通过sjId, shopId 获取 快递方的门店ID
- public static function getShopNo($sjId,$shopId,$label='dada')
- {
- $where = [
- 'sjId'=>$sjId,
- 'shopId'=>$shopId,
- 'label'=>$label
- ];
- $res = self::getByCondition($where);
- if(empty($res)){
- //写入一条
- $data = $where;
- $data['shopNo'] = '';
- self::add($data);
- return '';
- }
- return $res['shopNo'];
- }
- public static function updateShopNo($sjId,$shopId,$shopNo,$label ='dada')
- {
- $where = [
- 'sJid'=>$sjId,
- 'shopId'=>$shopId,
- 'label'=>$label
- ];
- self::getShopNo($sjId,$label);
- self::updateByCondition($where,['shopNo'=>$shopNo]);
- return true;
- }
- }
|